import request from '@/utils/request';

export function getArchivesByTypeAPI(type, page, size) {
    return request({
        url: `/client/archives/${type}`,
        method: 'GET',
        param: { page, size },
    });
}

export function getArchiveDetailAPI(aid) {
    return request({
        url: `/archive/base/${aid}`,
        method: 'GET',
    });
}
/**
 * 获取排行榜数据(按点击量获取)
 * @param {number} type 稿件类型
 * @param {number} limit 获取条目数
 */
export function getArchiveRankingAPI(type, limit) {
    return request({
        url: `/client/archives/ranking/${type}`,
        method: 'GET',
        params: { limit },
    });
}
/**
 * 随机获取推荐稿件
 * @param {number} type 稿件类型
 * @param {number} limit 获取条目
 */
export function getArchivesByRandomAPI(type, limit) {
    return request({
        url: `/client/archives/random/${type}`,
        method: 'GET',
        params: { limit },
    });
}
